package com.lyf.work1;
import java.util.Scanner;
import java.util.function.IntToDoubleFunction;

public class jiSangQi {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入第一个数字：");
        double a = sc.nextDouble();
        System.out.println("请输入操作符：(+ - * /)");
        String c = sc.next();
        System.out.println("请输入第二个数字：");
        double b = sc.nextDouble();
        System.out.println("结果为："+jisuan(a,b,c));

    }
    public static double jisuan(double a, double b,String c){
        switch (c){
            case "+":
                return a+b;
            case "-":
                return a-b;
            case "*":
                return a*b;
            case "/":
                return a/b;
            default:
                return 0;
        }
    }
}
